import request from '@/utils/request'

// 查询计划目标值列表
export function listTarget(query) {
  return request({
    url: '/project/target/list',
    method: 'get',
    params: query
  })
}

// 查询计划目标值详细
export function getTarget(targetId) {
  return request({
    url: '/project/target/' + targetId,
    method: 'get'
  })
}

// 新增计划目标值
export function addTarget(data) {
  return request({
    url: '/project/target',
    method: 'post',
    data: data
  })
}

// 修改计划目标值
export function updateTarget(data) {
  return request({
    url: '/project/target',
    method: 'put',
    data: data
  })
}

// 删除计划目标值
export function delTarget(targetId) {
  return request({
    url: '/project/target/' + targetId,
    method: 'delete'
  })
}

// 导出计划目标值
export function exportTarget(query) {
  return request({
    url: '/project/target/export',
    method: 'get',
    params: query
  })
}

//修改状态
export function changeTartFlag(targetId,targetFlag){

  const data = {
    targetId,
    targetFlag
  }
  return request({
    url: '/project/target',
    method: 'put',
    data: data
  })
}
